use std::{env, process::Command};

fn main() {
    let out_dir = env::var("OUT_DIR").unwrap();
    let status = Command::new("clang-18")
        .arg("-target")
        .arg("bpfel-unknown-none")
        .arg("-I/usr/include/x86_64-linux-gnu")
        .arg("-c")
        .arg("-emit-llvm")
        .arg("../runtime/main.c")
        .arg("-o")
        .arg(format!("{}/runtime.bc", out_dir))
        .status()
        .unwrap();
    assert!(status.success());
    println!("cargo:rerun-if-changed=../runtime/main.c");
}
